package cn.itsource.ymcc.controller;

import cn.itsource.ymcc.result.JsonResult;
import cn.itsource.ymcc.service.ICommonService;
import cn.itsource.ymcc.vo.PhoneCodeVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@RestController
public class CommonController {
    @Autowired
    private ICommonService commonService;
    @GetMapping("/getImageCode/{imgCodeKey}")
    public JsonResult getImageCode(@PathVariable("imgCodeKey")String imgCodeKey){
        return commonService.getImageCode(imgCodeKey);
    }

    @PostMapping("/sendSmsCode")
    public JsonResult sendSmsCode(@RequestBody @Valid PhoneCodeVo phoneCodeVo){
        return commonService.sendSmsCode(phoneCodeVo);
    }

}
